#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(this, &Widget::MySignal1, this, &Widget::HandleAllSignal);
    connect(this, &Widget::MySignal2, this, &Widget::HandleAllSignal);
    connect(this, &Widget::MySignal3, this, &Widget::HandleAllSignal);
    connect(this, &Widget::MySignal4, this, &Widget::HandleAllSignal);

    EmitAllSignal();
}

Widget::~Widget()
{
    delete ui;
}

void Widget::EmitAllSignal()
{
    emit MySignal1();
    emit MySignal2();
    emit MySignal3();
    emit MySignal4();
}

void Widget::HandleAllSignal()
{
    qDebug() << "HandleAllSignal()被执行";
}

